<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
	<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
		<table width="100%" border="0">
			<tr>
			    <td align="right"><span>姓名(模糊)</span></td>
			    <td><input id="name" class="mini-textbox" emptyText="请输入"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"><span>性别(精确)</span></td>
			    <td><input id="sex" class="mini-textbox" emptyText="请选择"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"><span>手机号(精确)</span></td>
			    <td><input id="telId" class="mini-textbox" emptyText="请输入"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"> </td>
			 </tr>
			 <tr>
			    <td align="right"><span>客户级别(精确)</span></td>
			    <td><input id="customerLevel" class="mini-textbox" emptyText="请选择"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"><span>客服代表(精确)</span></td>
			    <td><input id="customerServiceId" class="mini-textbox" emptyText="请选择"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"><span>编号(精确)</span></td>
			    <td><input id="serialNum" class="mini-textbox" emptyText="请输入"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"> </td>
			 </tr>
			 <tr>
			    <td align="right"><span>记录时间(开始时间)</span></td>
			    <td><input id="createTime" class="mini-datepicker" style="width:160px;" format="yyyy-MM-dd H:mm:ss" timeFormat="H:mm:ss" showTime="true" showOkButton="true" showClearButton="false" onenter="onKeyEnter"/> </td>
			    <td align="right"><span>记录时间(截至时间)</span></td>
			    <td><input id="createTime" class="mini-datepicker" style="width:160px;" format="yyyy-MM-dd H:mm:ss" timeFormat="H:mm:ss" showTime="true" showOkButton="true" showClearButton="false" onenter="onKeyEnter"/> </td>
			    <td align="right"><span>客服代表(包含)</span></td>
			    <td><input id="userId" class="mini-textbox" emptyText="请选择"  onenter="onKeyEnter" style="width:160px;"/></td>
			    <td align="right"> </td>
			 </tr>
			 <tr>
			   	<td align="right"><span>有效订单数(精确)</span></td>
			    <td><input id="serialNum" class="mini-textbox" emptyText="请输入"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"><span>产品(模糊)</span></td>
			    <td><input id="serialNum" class="mini-textbox" emptyText="请输入"  onenter="onKeyEnter" style="width:160px;"/> </td>
			    <td align="right"></td>
			    <td> </td>
			    <td><a class="mini-button" onclick="search()">查询</a> </td>
			 </tr>
		</table>          
	</div>
	<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
	    <table style="width:100%;">
	        <tr>
	            <td style="width:100%;">
	                <a class="mini-button" iconCls="icon-download" onclick="exportCurrentData()">导出当前</a>
		            <a class="mini-button" iconCls="icon-download" onclick="exportData()">导出全部</a>     
	            </td>
	        </tr>
	    </table>           
	</div>
	<div class="mini-fit" >
	<div id="datagrid1" class="mini-datagrid " idField="id" pageSize="20" url="group_customer_view.do" style="width:100%;height:93.5%;">
		<div property="columns">
			<div type="indexcolumn"></div>
			<div field="serialNum" width="100" headerAlign="center" align="center">编号</div>
			<div field="name" width="100" headerAlign="center" align="center">姓名</div>
			<div width="100" headerAlign="center" align="center" renderer="onActionRenderer">详细信息</div>
			<div field="sex" width="100" headerAlign="center" align="center">性别</div>
			<div field="provinceId" width="100" headerAlign="center" align="center">省份</div>
			<div field="telId" width="100" headerAlign="center" align="center">电话号码</div>
			<div field="ordersCountId" width="100" headerAlign="center" align="center">有效订单数</div>
			<div field="customersSource" width="100" headerAlign="center" align="center">客户来源</div>
			<div field="recordingTime" width="120" headerAlign="center" dateFormat="yyyy-MM-dd HH:mm:ss" align="center">记录时间</div>
			<div field="customerLevel" width="100" headerAlign="center" align="center">客户级别</div>
		</div>
	</div>
	</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();

function search() {
    grid.load();
}

function onKeyEnter(e) {
    search();
}

//导出全部
function exportData() {
	location.href="my_customer_export.do";
}

//导出当前页数据
function exportCurrentData() {
	var data =grid.getData();
	var ids = [];
	$.each(data , function(){
        ids.push(this.id);
    });
	 var id = ids.join(',');
	 location.href="group_customer_current_export.do?ids=" +id;
}
</script>
</body>
</html>